<div id = "rleft">
<p id="title"><?php  echo $this->title; ?>  </p>
<form id="xform" method="POST" name="boo">
<?php
$p = new Point();
$r = new Route ();
$c = 0;
$action = 'insert';
if (isset ( $this->objectData )) {
	$action = 'update';
	$list = $r->getAllNameinRoute ( $this->bind ( 'id' ) );
	$c = 1;
}
?>
<input type="hidden" name="actiontype" value="<?php echo $action;?>" />
	<input type="hidden" name="Route_id" id="route_id"
		value="<?php echo $this->bind('id')?>">
		<?php
		$hihi = 1;
		if ($c == 1) {
			foreach ( $list as $value ) {
				echo '<div class="elem">';
				echo '<label style="width:25%;float:left" for="pos">'.Resource::getResource('pointposition').'</label>';
				if ($hihi == 1){
					echo '<label style="width:70%;float:right" for="route_pointstart">' . Resource::getResource ( 'pointstart' ) . '</label>';
					$x = $p->getinfoPoint($value['id']);
				}
				else {
					if ($hihi == count ( $list )){
						echo '<label style="width:70%;float:right" for="route_pointend">' . Resource::getResource ( 'pointend' ) . '</label>';
						$q = $p->getinfoPoint($value['id']);
					}
					else
						echo '<label style="width:70%;float:right" for="route_pointmid">' . Resource::getResource ( 'pointmid' ) . '</label>';
				}
				echo '<input id="pos" style="text-align : center; width : 10%;margin-left: 15px;padding:5px;" type = "text" value="'.$value['position'].'" readonly="readonly">';
				echo '<input id="'.$value['id'].'" type="text" style="padding:5px;text-align : center;margin-left: 35px;width : 65%;" value="' . $value ['name'] . '" readonly="readonly">';
				echo '</div>';
				$hihi += 1;
			}
		} else
			echo '<button onclick="showformpoint()">'.Resource::getResource ( 'chosepoint' ).'</button>';
		?> 
	<div class="elem">
		<label for="route_price"> <?php echo Resource::getResource('price'); ?></label>
		<input type="text" name="Route_price" id="route_price"
			value="<?php echo $this->bind('price')?>">
	</div>
	<button type="submit" onclick="document.boo.submit()"
		style="display: none;">Save</button>
</form>
</div>
<div id="rright">
<?php $this->block('routeright');?>
</div>